package com.zbcz.erp.bean

import android.os.Parcel
import android.os.Parcelable

class MyToolsBean() : Parcelable {
    var id: String? = null // 流程实例的唯一标识符
    var createBy: String?? = null  // 创建者（为空）
    var createTime: String? = null // 创建时间
    var delFlag: String?? = null  // 删除标志（为空）
    var updateBy: String? = null // 更新者
    var updateTime: String? = null // 更新时间
    var categoryId: String? = null // 类别ID
    var deploymentId: String? = null // 部署ID
    var description: String? = null // 描述
    var diagramName: String? = null // 流程图名称
    var latest: String? = null // 是否是最新版本
    var name: String? = null // 流程名称
    var processKey: String? = null // 流程键
    var status: String? = null // 状态（1为启用，0为禁用）
    var version: String? = null // 版本号
    var businessTable: String? = null // 业务表名称
    var routeName: String? = null // 路由名称
    var roles: String?? = null // 角色（为空）
    var routerId: Int = 0

    constructor(parcel: Parcel) : this() {
        id = parcel.readString()
        createBy = parcel.readString()
        createTime = parcel.readString()
        delFlag = parcel.readString()
        updateBy = parcel.readString()
        updateTime = parcel.readString()
        categoryId = parcel.readString()
        deploymentId = parcel.readString()
        description = parcel.readString()
        diagramName = parcel.readString()
        latest = parcel.readString()
        name = parcel.readString()
        processKey = parcel.readString()
        status = parcel.readString()
        version = parcel.readString()
        businessTable = parcel.readString()
        routeName = parcel.readString()
        roles = parcel.readString()
        routerId = parcel.readInt()
    }

    constructor(id: Int, name: String) : this() {
        this.id = id.toString()
        this.description = name
        this.routerId = id
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(createBy)
        parcel.writeString(createTime)
        parcel.writeString(delFlag)
        parcel.writeString(updateBy)
        parcel.writeString(updateTime)
        parcel.writeString(categoryId)
        parcel.writeString(deploymentId)
        parcel.writeString(description)
        parcel.writeString(diagramName)
        parcel.writeString(latest)
        parcel.writeString(name)
        parcel.writeString(processKey)
        parcel.writeString(status)
        parcel.writeString(version)
        parcel.writeString(businessTable)
        parcel.writeString(routeName)
        parcel.writeString(roles)
        parcel.writeInt(routerId)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<MyToolsBean> {
        override fun createFromParcel(parcel: Parcel): MyToolsBean {
            return MyToolsBean(parcel)
        }

        override fun newArray(size: Int): Array<MyToolsBean?> {
            return arrayOfNulls(size)
        }
    }
}
